package com.hoperun.checkcloth.net;

import android.os.Handler;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.hoperun.checkcloth.entity.ClothEntity;
import com.hoperun.checkcloth.entity.MaterialEntity;
import com.hoperun.checkcloth.entity.ProductEntity;
import com.hoperun.checkcloth.entity.XCXX;
import com.hoperun.checkcloth.entity.XiaciInfo;
import com.hoperun.checkcloth.util.LanguageUtil;

import org.json.JSONArray;
import org.json.JSONObject;

import java.util.List;

public class RequestServiceImpl {

    /**
     * 获取新版本
     *
     * @param handler
     * @param requestType
     */
    public static void getNewVersion(Handler handler, int requestType, String appname) {

        JSONObject inputInfo = new JSONObject();
        try {
            inputInfo.put("appname", appname);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "autoUpdate";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 查询数据字典
     *
     * @param handler
     * @param requestType
     * @param SJZDID
     */
    public static void querySJZD(Handler handler, int requestType, String SJZDID) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("SJZDID", SJZDID);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "querySJZDBySJZDID";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 4.3.1. 登陆接口
     *
     * @param handler
     * @param requestType
     */
    public static void login(Handler handler, int requestType, String YHBH,String YHKL) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHKL", YHKL);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "zjPDALogin";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 4.3.2. 根据三联号获取相关基本信息 业务描述：PDA在录入瑕疵信息时，根据三联号获取相关基本信息
     *
     * @param handler
     * @param requestType
     * @param monadNo
     */
    public static void queryByMonadNo(Handler handler, int requestType, String monadNo, String YHBH) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("MONADNO", monadNo);
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());
        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "zjQueryByMonadNo";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    // “BATCHNO”:”xxxx” , ——批号
    // “CLOTHNO”:”xxxx” , ——布号
    // “MACHINENO”:”xxxx” , ——车号
    // “WEIGHT”:”xxxx” , ——重量
    // “METERLONG”:”xxxx” , ——米长
    // “GRADENO”:”xxx” , ——班次
    // “EMPID”:”xxx”, ——照布工ID -- 当前登陆的YHBH
    // “CLOTHWORKER”:”xxx” ——照布工名称 -- 当前登陆人 YHM

    /**
     * @param handler
     * @param requestType
     * @param
     */
    public static void checkCommit(Handler handler, int requestType, ClothEntity cloth, List<XCXX> XCXXs) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());
            inputInfo.put("MONADNO", cloth.MONADNO);
            inputInfo.put("BATCHNO", cloth.BATCHNO);
            inputInfo.put("CLOTHNO", cloth.CLOTHNO);
            inputInfo.put("MACHINENO", cloth.MACHINENO);
            inputInfo.put("WEIGHT", cloth.WEIGHT);
            inputInfo.put("METERLONG", cloth.METERLONG);
            inputInfo.put("GRADENO", cloth.GRADENO);
            inputInfo.put("EMPID", cloth.EMPID);
            inputInfo.put("CLOTHWORKER", cloth.CLOTHWORKER);

            Gson gson = new Gson();
            String array = gson.toJson(XCXXs);
            JSONArray jsonArray = new JSONArray(array);
            inputInfo.put("XCXX", jsonArray);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "zjClothQtyCheckDetailCommit";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


/**********************************************以下是 布头检验系统的********************************************/

    /**
     * 布头检验登录请求
     *
     * @param handler
     * @param account  员工工号
     * @param password 密码
     */
    public static void loginButou(Handler handler, int requestType, String account, String password) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHM", account);
            inputInfo.put("YHKL", password);
            inputInfo.put("BMMC", "");

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "login";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


    /**
     * 根据三联号获取相关基本信息
     *
     * @param handler
     * @param requestType
     */
    public static void btQueryByClothtktNo(Handler handler, int requestType, String clothTktNo) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("CLOTHTKTNO", clothTktNo);

            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());
        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "btQueryByClothtktNo";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


    public static void btClothQtyCheckDetailCommit(Handler handler, int requestType, ClothEntity cloth, List<XCXX> XCXXs, String userBean) {

        JSONObject inputInfo = new JSONObject();

        try {

            JSONObject jsonObject = new JSONObject(userBean);
            inputInfo.put("userBean", jsonObject);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());
            inputInfo.put("CLOTHTKTNO", cloth.MONADNO);
            Gson gson = new Gson();
            String array = gson.toJson(XCXXs);
            JSONArray jsonArray = new JSONArray(array);
            inputInfo.put("XCXX", jsonArray);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "btClothQtyCheckDetailCommit";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /***
     *  原料检验录入 查询字典
     */
    public static void getDc(Handler handler, int requestType) {
        JSONObject inputInfo = new JSONObject();
        String methodName = "getDc";
        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 原料检验录入 获取特殊字段的拼接字符，就是获取单位:  根 匹 等
     */
    public static void getDcs(Handler handler, int requestType) {
        JSONObject inputInfo = new JSONObject();
        try {
            inputInfo.put("SJZDID", "YLZL_YLZLLRS");
        } catch (Exception e) {
            // ignore
        }
        String methodName = "getDcs ";
        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 原料检验录入 查询带出原料列表信息
     */
    public static void getYlzlCheckListInfo(Handler handler, int requestType, String CLOTHTKTNO, String userBean) {
        JSONObject inputInfo = new JSONObject();
        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);
            JSONObject jsonObject = new JSONObject(userBean);
            inputInfo.put("userBean", jsonObject);

        } catch (Exception e) {
            // ignore
        }

        String methodName = "getYlzlCheckListInfo";
        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 原料检验录入 查询已经保存的数据
     */
    public static void getYlzllrUpdateInfo(Handler handler, int requestType, String CLOTHTKTNO, String YLWZ) {
        JSONObject inputInfo = new JSONObject();
        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);
            inputInfo.put("YLWZ", YLWZ);
        } catch (Exception e) {
            // ignore
        }
        String methodName = "getYlzllrUpdateInfo";
        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 原料检验录入 保存信息
     */
    public static void saveOrUpdateYlzllr(Handler handler, int requestType, MaterialEntity cloth, List<XiaciInfo> xiaciNumList, String userBean) {
        JSONObject inputInfo = new JSONObject();
        try {
            JSONObject jsonObject = new JSONObject(userBean);
            inputInfo.put("userBean", jsonObject);
            JSONObject detail = new JSONObject();
            detail.put("PKID", cloth.getPKID());
            detail.put("MATERIALID", cloth.getMATERIALID());
            detail.put("CLOTHTKTNO", cloth.getCLOTHTKTNO());
            detail.put("BATCHNO", cloth.getBATCHNO());
            detail.put("CLOTHNO", cloth.getCLOTHNO());
            detail.put("MACHINENO", cloth.getMACHINENO());
            detail.put("YLID", cloth.getYLID());
            detail.put("ORIPLACE", cloth.getORIPLACE());
            detail.put("WEIGHT", cloth.getWEIGHT());
            detail.put("COLORNO", cloth.getCOLORNO());
            detail.put("YLWZ", cloth.getYLWZ());
            detail.put("SZQC", cloth.getSZQC());
            for (int i = 0; i < xiaciNumList.size(); i++) {
                XiaciInfo xiaciInfo = xiaciNumList.get(i);
                detail.put(xiaciInfo.getKEYCODE(), xiaciInfo.getXCSL());
            }
            inputInfo.put("QTYMATERIALDETAIL", detail);
        } catch (Exception e) {
            // ignore
        }
        String methodName = "saveOrUpdateYlzllr";
        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 剖幅工产量录入登陆
     */
    public static void pfgcl_login(Handler handler, int requestType, String gh,String pwd) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("GH", gh);
            inputInfo.put("PASSWORD", pwd);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "pfgclLogin";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     * 剖幅工产量录入根据三联单好保存数据
     */
    public static void cllrByMonadNo(Handler handler, int requestType, String monadNo, String YHBH) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("MONADNO", monadNo);
            inputInfo.put("GH", YHBH);
            inputInfo.put("LANGUAGE", LanguageUtil.getLanguageStr());
        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "cllrByMonadNo";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 登陆接口
     *
     * @param handler
     * @param requestType
     */
    public static void jy_login(Handler handler, int requestType, String YHBH,String YHKL) {

        JSONObject inputInfo = new JSONObject();

        try {
//"JY142"
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHKL", YHKL);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "jycjLogin";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 织造查询
     *
     * @param handler
     * @param requestType
     */
    public static void jy_query(Handler handler, int requestType, String JobDate, String YHBH, String CLOTHTKTNO, String CELLNO, String EMPNO) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("LISTDATE", JobDate);
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);
            inputInfo.put("CELLNO", CELLNO);
            inputInfo.put("EMPNO", EMPNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "longFaultList";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 织造查询三联号
     *
     * @param handler
     * @param requestType
     */
    public static void jy_querysanlian(Handler handler, int requestType, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "longFaultbyClothtktno";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 织造保存
     *
     * @param handler
     * @param requestType
     */
    public static void jy_shurelist(Handler handler, int requestType, String YHBH, String YHMC, String TYPE, String object) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHMC", YHMC);
            inputInfo.put("TYPE", TYPE);
            inputInfo.put("jsonData", object);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "longFaultSave";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 织造删除
     *
     * @param handler
     * @param requestType
     */
    public static void jy_deletelist(Handler handler, int requestType, String PKIDS) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("PKIDS", PKIDS);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "longFaultDel";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 针头查询三联号
     *
     * @param handler
     * @param requestType
     */
    public static void jy_querysanlianzt(Handler handler, int requestType, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "needleHeadbyClothtktno";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 针头保存
     *
     * @param handler
     * @param requestType
     */
    public static void jy_shureztlist(Handler handler, int requestType, String YHBH, String YHMC,String TYPE,String jsonstr) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHMC", YHMC);
            inputInfo.put("TYPE", TYPE);
            inputInfo.put("jsonData", jsonstr);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "needleHeadSave";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 针头删除
     *
     * @param handler
     * @param requestType
     */
    public static void jy_deleteztlist(Handler handler, int requestType, String PKIDS) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("PKIDS", PKIDS);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "needleHeadDel";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 针头查询
     *
     * @param handler
     * @param requestType
     */
    public static void jy_queryzt(Handler handler, int requestType, String JobDate, String YHBH, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("LISTDATE", JobDate);
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "needleHeadList";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 车间保存
     *
     * @param handler
     * @param requestType
     */
    public static void jy_shurechejianlist(Handler handler, int requestType, String YHBH, String YHMC,String TYPE,String jsonstr) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHMC", YHMC);
            inputInfo.put("TYPE", TYPE);
            inputInfo.put("jsonData", jsonstr);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "inspectSave";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 车间删除
     *
     * @param handler
     * @param requestType
     */
    public static void jy_deletechejianlist(Handler handler, int requestType, String PKIDS) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("PKIDS", PKIDS);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "inspectDel";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 车间查询
     *
     * @param handler
     * @param requestType
     */
    public static void jy_querychejian(Handler handler, int requestType, String JobDate, String YHBH, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("LISTDATE", JobDate);
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "inspectList";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 针头查询三联号
     *
     * @param handler
     * @param requestType
     */
    public static void jy_querysanlianchejian(Handler handler, int requestType, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "inspectbyClothtktno";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


    /**
     *检验 首批确认查询三联号
     *
     * @param handler
     * @param requestType
     */
    public static void jy_queryfirstshure(Handler handler, int requestType, String CLOTHTKTNO) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "firstConfbyClothtktno";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *检验 首次确认  确认保全工
     *
     * @param handler
     * @param requestType
     */
    public static void jy_shurebqg(Handler handler, int requestType, String YHBH, String YHMC,String reson,JSONObject resultjson,List<JSONObject> jyfirstlist) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHMC", YHMC);
            inputInfo.put("FLAG", jyfirstlist.size()+"");
            inputInfo.put("CLOTHTKTNO",  resultjson.optString("CLOTHTKTNO").toString());
            inputInfo.put("CLOTHNO",  resultjson.optString("CLOTHNO").toString());
            inputInfo.put("WORKSHOP",  resultjson.optString("WORKSHOP").toString());
            inputInfo.put("MACHINENO",  resultjson.optString("MACHINENO").toString());
            inputInfo.put("CAUSE",  reson);
            inputInfo.put("BQGBH",  resultjson.optString("BQGBH").toString());
            inputInfo.put("BQGXM",  resultjson.optString("BQGXM").toString());
            inputInfo.put("LIST", jyfirstlist.toString());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "firstConfConfirm";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


    /**
     *检验 首次确认  确认保全工
     *
     * @param handler
     * @param requestType
     */
    public static void jy_notshurebqg(Handler handler, int requestType, String YHBH, String YHMC,String reson,JSONObject resultjson,List<JSONObject> jyfirstlist) {

        JSONObject inputInfo = new JSONObject();

        try {
            inputInfo.put("YHBH", YHBH);
            inputInfo.put("YHMC", YHMC);
            inputInfo.put("FLAG", jyfirstlist.size()+"");
            inputInfo.put("CLOTHTKTNO",  resultjson.optString("CLOTHTKTNO").toString());
            inputInfo.put("CLOTHNO",  resultjson.optString("CLOTHNO").toString());
            inputInfo.put("WORKSHOP",  resultjson.optString("WORKSHOP").toString());
            inputInfo.put("MACHINENO",  resultjson.optString("MACHINENO").toString());
            inputInfo.put("CAUSE",  reson);
            inputInfo.put("BQGBH",  resultjson.optString("BQGBH").toString());
            inputInfo.put("BQGXM",  resultjson.optString("BQGXM").toString());

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "firstConfNoConfirm";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    /**
     *获取系统时间
     *
     * @param handler
     * @param requestType
     */
    public static void jy_getsysdate(Handler handler, int requestType) {


        String methodName = "getSysdate";

        IServiceImpl.callWebMethod(handler, requestType, "", methodName);
    }


    /**
     *坯布 登陆接口
     *
     * @param handler
     * @param requestType
     */
    public static void bang_login(Handler handler, int requestType, String YHBH,String password) {

        JSONObject inputInfo = new JSONObject();

        try {
//"JY142"
            inputInfo.put("YHM", YHBH);
            inputInfo.put("YHKL", password);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "login";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }


    /**
     * 页面初始化统计当日匹数与重量
     * @param handler
     * @param requestType
     */
    public static void getInitInfo(Handler handler,int requestType, String userBean) {

        JSONObject inputInfo = new JSONObject();

        try {
            JSONObject jsonObject=new JSONObject(userBean);
            inputInfo.put("userBean", jsonObject);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName="TickettoinitApp" ;

        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
    }



    /**
     * 根据三联单号带出数据
     * @param handler
     * @param requestType
     * @param clothTktNo
     */
    public static void getProductInfo(Handler handler,int requestType, String clothTktNo) {


        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("CLOTHTKTNO", clothTktNo);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName="TicketfetchDataApp" ;

        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
    }






    /**
     * 判断胚布是否已经称重
     * @param handler
     * @param requestType
     * @param clothTktNo
     */
    public static void getIsStandard(Handler handler,int requestType, String clothTktNo) {


        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("CLOTHTKTNO", clothTktNo);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName="TicketisStandardApp" ;

        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
    }






    /**
     * 判断三联单号是否已扫描
     * @param handler
     * @param requestType
     * @param clothTktNo
     */
//    public static void getIsExists(Handler handler,int requestType, String clothTktNo) {
//
//
//        JSONObject inputInfo = new JSONObject();
//
//        try {
//
//            inputInfo.put("CLOTHTKTNO", clothTktNo);
//
//
//        } catch (Exception e) {
//            // TODO: handle exception
//        }
//        String methodName="TicketisExistsApp" ;
//
//        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
//    }


    /**
     * 新增坯布称重信息
     * @param handler
     * @param requestType
     * @param product
     */
    public static void addProduct(Handler handler,int requestType , String userBean, ProductEntity product) {


        JSONObject inputInfo = new JSONObject();

        try {

            JSONObject jsonObjectUserBean=new JSONObject(userBean);
            inputInfo.put("userBean", jsonObjectUserBean);
            Gson gson = new GsonBuilder().serializeNulls().create();
            JSONObject jsonObjectProduct=new JSONObject(gson.toJson(product));
            inputInfo.put("jsonData", jsonObjectProduct);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName="TicketeditApp" ;

        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
    }

    /**
     * 页面初始化统计当日匹数与重量
     * @param handler
     * @param requestType
     */
    public static void getBanList(Handler handler,int requestType, String userBean) {

        JSONObject inputInfo = new JSONObject();

        try {
            JSONObject jsonObject=new JSONObject(userBean);
            inputInfo.put("userBean", jsonObject);


        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName="TickettoListApp" ;

        IServiceImpl.callWebMethod(handler, requestType, inputInfo , methodName);
    }

    /**
     *检验 织造查询
     *
     * @param handler
     * @param requestType
     */
    public static void zz_query(Handler handler, int requestType, String WORKSHOP, String LISTDATE_FROM, String LISTDATE_TO, String CLOTHTKTNO, String MACHINENO_FROM,String MACHINENO_TO) {

        JSONObject inputInfo = new JSONObject();

        try {

            inputInfo.put("WORKSHOP", WORKSHOP);
            inputInfo.put("LISTDATE_FROM", LISTDATE_FROM);
            inputInfo.put("LISTDATE_TO", LISTDATE_TO);
            inputInfo.put("CLOTHTKTNO", CLOTHTKTNO);
            inputInfo.put("MACHINENO_FROM", MACHINENO_FROM);
            inputInfo.put("MACHINENO_TO", MACHINENO_TO);

        } catch (Exception e) {
            // TODO: handle exception
        }
        String methodName = "longFaultList";

        IServiceImpl.callWebMethod(handler, requestType, inputInfo, methodName);
    }

    public static void zz_getchejian(Handler handler, int requestType) {

        String methodName = "toQueryWorkShop";

        IServiceImpl.callWebMethod(handler, requestType, "", methodName);
    }

}
